package com.shensi.adminCollect.domain.customer;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.shensi.adminCollect.common.annotation.Excel;
import com.shensi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.sql.Time;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * 客户电子会员卡充值优惠设置明细对象 customer_card_setting_detail
 *
 * @author qujia
 * @date 2021-04-06
 */
@ApiModel("客户电子会员卡充值优惠设置明细对象")
public class CustomerCardSettingDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    public static final String SETTING_STATUS_NORMAL="NORMAL";
    public static final String SETTING_STATUS_FREEZE="FREEZE";
    public static final String SETTING_STATUS_STOP="STOP";
    public static final String ACTIVITYTYPE_BALANCE="balance";
    public static final String ACTIVITYTYPE_COUPON="coupon";
    public static final String ACTIVITYTYPE_INTEGRAL="integral";
    public static final String ACTIVITY_MODE_RECHARGE="recharge";
    public static final String ACTIVITY_MODE_CONSUME="consume";
    public static final String according_to_litres="litres";
    public static final String according_to_money="money";

    public static final String periodType_week = "week";
    public static final String periodType_month = "month";
    /** $column.columnComment */
    @ApiModelProperty("id")
    private Long id;

    /** 所对应电子会员卡ID */
    @Excel(name = "所对应电子会员卡ID")

    private Long parentId;

    /** 设置充值优惠类型：1，按赠送金额；2，按赠送比例 */
    @Excel(name = "设置充值优惠类型：1，按赠送金额；2，按赠送比例")
    @ApiModelProperty("设置充值优惠类型：1，按赠送金额；2，按赠送比例")
    private String settingRuleType;
    private BigDecimal discountAmtStart;
    private BigDecimal discountAmtEnd;
    //电子卡类型，1汽油，2柴油，3非油品，4LNG 5CNG
    @ApiModelProperty("电子卡类型，1汽油，2柴油，3非油品，4LNG 5CNG")
    private String cardType;

    //是否开启优惠活动（1，开启，2  关闭）
    @ApiModelProperty("充值活动状态 NORMAL正常、FREEZE冻结、STOP停止")
    private String status;
    private String cardOilsType;
    private String discountTimeSetting;
    private String discountTimeType;
    private String isDiscountCoupon;
    private String isGradeSetting;
    private String isMarket;
    private String presentScale;
    private String enjoyIntegralMultiple;
    private String delFlag;
    @ApiModelProperty("油企id")
    private Long enterpriseId;
    @ApiModelProperty("油站id")
    private Long stationId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    private String enterpriseName;
    private String stationName;

    private Long createUser;
    //按升数 litres /按金额 amount
    @ApiModelProperty("按升数 litres /按金额 amount")
    private String accordingTo;


    //活动类型 电子卡余额balance/优惠卷coupon/积分integral
    @ApiModelProperty("活动类型 电子卡余额balance/优惠卷coupon/积分integral")
    private String activityType;
//支付方式  zfb wx dzk_pos dzk_wx dzk_ht
@ApiModelProperty("支付方式  zfb/支付宝 wx/微信 dzk_pos/电子卡pos机 dzk_wx/电子卡微信消费 dzk_ht/电子卡后台消费")
    private String payType;
//活动方式recharge/充值 consume/消费
@ApiModelProperty("活动方式recharge/充值 consume/消费")
    private String activityMode;

    @ApiModelProperty("时段类型      全部时段 all/按周选择 week/按月选择 month")
    private String periodType;
    @ApiModelProperty("按周选择   1,2,3,4,5,6,7")
    private String weeklySelection;
    @ApiModelProperty("按月选择  1,2,3......,31")
    private String monthlySelection;
    @ApiModelProperty("周生效时间开始")
    private Time weekEffectiveTimeStart;
    @ApiModelProperty("周生效时间结束")
    private Time weekEffectiveTimeEnd;
    @ApiModelProperty("月生效时间开始")
    private Time monthEffectiveTimeStart;
    @ApiModelProperty("月生效时间结束")
    private Time monthEffectiveTimeEnd;
    @ApiModelProperty("活动开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activityTimeStart;
    @ApiModelProperty("活动结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activityTimeEnd;

    private Date nowDate;

    private String weekTimeRangeType;//周选择    时间段生效类型 按每天 each\按所有天 entire
    private String monthTimeRangeType;//月选择   时间段生效类型 按每天 each\按所有天 entire

    public String getWeekTimeRangeType() {
        return weekTimeRangeType;
    }

    public void setWeekTimeRangeType(String weekTimeRangeType) {
        this.weekTimeRangeType = weekTimeRangeType;
    }

    public String getMonthTimeRangeType() {
        return monthTimeRangeType;
    }

    public void setMonthTimeRangeType(String monthTimeRangeType) {
        this.monthTimeRangeType = monthTimeRangeType;
    }

    public Date getNowDate() {
        return nowDate;
    }

    public void setNowDate(Date nowDate) {
        this.nowDate = nowDate;
    }

    public String getPeriodType() {
        return periodType;
    }

    public void setPeriodType(String periodType) {
        this.periodType = periodType;
    }

    public String getWeeklySelection() {
        return weeklySelection;
    }

    public void setWeeklySelection(String weeklySelection) {
        this.weeklySelection = weeklySelection;
    }

    public String getMonthlySelection() {
        return monthlySelection;
    }

    public void setMonthlySelection(String monthlySelection) {
        this.monthlySelection = monthlySelection;
    }



    private BigDecimal amt ;//金额

    public BigDecimal getAmt() {
        return amt;
    }

    public void setAmt(BigDecimal amt) {
        this.amt = amt;
    }

    public String getAccordingTo() {
        return accordingTo;
    }

    public void setAccordingTo(String accordingTo) {
        this.accordingTo = accordingTo;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getActivityMode() {
        return activityMode;
    }

    public void setActivityMode(String activityMode) {
        this.activityMode = activityMode;
    }

    public Long getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }



    public String getActivityType() {
        return activityType;
    }

    public void setActivityType(String activityType) {
        this.activityType = activityType;
    }

    public Long getStationId() {
        return stationId;
    }

    public void setStationId(Long stationId) {
        this.stationId = stationId;
    }

    public String getEnterpriseName() {
        return enterpriseName;
    }

    public void setEnterpriseName(String enterpriseName) {
        this.enterpriseName = enterpriseName;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    /*   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date beginTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @Override
    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    @Override
    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }*/

    private List<CustomerCardSettingDetailContent> contentList;

    public List<CustomerCardSettingDetailContent> getContentList() {
        return contentList;
    }

    public void setContentList(List<CustomerCardSettingDetailContent> contentList) {
        this.contentList = contentList;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    private String wxContent;
    //0不发送 1发送
    private Integer sendFlag;

    public Long getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(Long enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public String getEnjoyIntegralMultiple() {
        return enjoyIntegralMultiple;
    }

    public void setEnjoyIntegralMultiple(String enjoyIntegralMultiple) {
        this.enjoyIntegralMultiple = enjoyIntegralMultiple;
    }

    public String getPresentScale() {
        return presentScale;
    }

    public void setPresentScale(String presentScale) {
        this.presentScale = presentScale;
    }

    public String getCardOilsType() {
        return cardOilsType;
    }

    public void setCardOilsType(String cardOilsType) {
        this.cardOilsType = cardOilsType;
    }

    public String getDiscountTimeSetting() {
        return discountTimeSetting;
    }

    public void setDiscountTimeSetting(String discountTimeSetting) {
        this.discountTimeSetting = discountTimeSetting;
    }

    public String getDiscountTimeType() {
        return discountTimeType;
    }

    public void setDiscountTimeType(String discountTimeType) {
        this.discountTimeType = discountTimeType;
    }

    public String getIsDiscountCoupon() {
        return isDiscountCoupon;
    }

    public void setIsDiscountCoupon(String isDiscountCoupon) {
        this.isDiscountCoupon = isDiscountCoupon;
    }

    public String getIsGradeSetting() {
        return isGradeSetting;
    }

    public void setIsGradeSetting(String isGradeSetting) {
        this.isGradeSetting = isGradeSetting;
    }

    public String getIsMarket() {
        return isMarket;
    }

    public void setIsMarket(String isMarket) {
        this.isMarket = isMarket;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public BigDecimal getDiscountAmtStart() {
        return discountAmtStart;
    }

    public void setDiscountAmtStart(BigDecimal discountAmtStart) {
        this.discountAmtStart = discountAmtStart;
    }

    public BigDecimal getDiscountAmtEnd() {
        return discountAmtEnd;
    }

    public void setDiscountAmtEnd(BigDecimal discountAmtEnd) {
        this.discountAmtEnd = discountAmtEnd;
    }

    /** 赠送金额值或者赠送c充值金额的比例 */
    @Excel(name = "赠送金额值或者赠送c充值金额的比例")
    private BigDecimal presentAmt;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() {
        return this.id;
    }
    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public Long getParentId()
    {
        return parentId;
    }
    public void setSettingRuleType(String settingRuleType)
    {
        this.settingRuleType = settingRuleType;
    }

    public String getSettingRuleType()
    {
        return settingRuleType;
    }
    public void setPresentAmt(BigDecimal presentAmt)
    {
        this.presentAmt = presentAmt;
    }

    public BigDecimal getPresentAmt()
    {
        return presentAmt;
    }

    public String getWxContent() {
        return wxContent;
    }

    public void setWxContent(String wxContent) {
        this.wxContent = wxContent;
    }

    public Integer getSendFlag() {
        return sendFlag;
    }

    public void setSendFlag(Integer sendFlag) {
        this.sendFlag = sendFlag;
    }

    public Time getWeekEffectiveTimeStart() {
        return weekEffectiveTimeStart;
    }

    public void setWeekEffectiveTimeStart(Time weekEffectiveTimeStart) {
        this.weekEffectiveTimeStart = weekEffectiveTimeStart;
    }

    public Time getWeekEffectiveTimeEnd() {
        return weekEffectiveTimeEnd;
    }

    public void setWeekEffectiveTimeEnd(Time weekEffectiveTimeEnd) {
        this.weekEffectiveTimeEnd = weekEffectiveTimeEnd;
    }

    public Time getMonthEffectiveTimeStart() {
        return monthEffectiveTimeStart;
    }

    public void setMonthEffectiveTimeStart(Time monthEffectiveTimeStart) {
        this.monthEffectiveTimeStart = monthEffectiveTimeStart;
    }

    public Time getMonthEffectiveTimeEnd() {
        return monthEffectiveTimeEnd;
    }

    public void setMonthEffectiveTimeEnd(Time monthEffectiveTimeEnd) {
        this.monthEffectiveTimeEnd = monthEffectiveTimeEnd;
    }

    public Date getActivityTimeStart() {
        return activityTimeStart;
    }

    public void setActivityTimeStart(Date activityTimeStart) {
        this.activityTimeStart = activityTimeStart;
    }

    public Date getActivityTimeEnd() {
        return activityTimeEnd;
    }

    public void setActivityTimeEnd(Date activityTimeEnd) {
        this.activityTimeEnd = activityTimeEnd;
    }

    public static String dateToWeek(Date date) {
        Calendar cal = Calendar.getInstance(); // 获得一个日历
        Date datet = date;
        cal.setTime(datet);
        int w = cal.get(Calendar.DAY_OF_WEEK) - 1; // 指示一个星期中的某天。
        if (w < 0)
            w = 0;
        return w+"";
    }

    public static String dateToMonth(Date date){
        Calendar calendar = Calendar.getInstance();

        // 获取今天的日份
        int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);

        return dayOfMonth+"";
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("parentId", getParentId())
            .append("settingRuleType", getSettingRuleType())
            .append("discountAmtStart", getDiscountAmtStart())
            .append("discountAmtEnd", getDiscountAmtEnd())
            .append("presentAmt", getPresentAmt())
            .append("status", getStatus())
            .append("cardType", getCardType())
            .toString();
    }
}
